# -*- coding: utf8 -*-

_author_ = "boboxu"

if __name__=='__main__':
    '''
    添加工作路径
    引用自己写的模块
    '''
    import sys
    import os
    # 获取当前绝对路径
    curPath = os.path.abspath(os.path.dirname(__file__))
    rootPath = os.path.split(curPath)[0]+'\..'
    # 设置模块搜索路径为Root目录
    sys.path.append(rootPath)

from time import sleep
from datetime import datetime
from abc import ABCMeta, abstractmethod
import pandas as pd

# 自己的模块
from LQT.constant import *
from LQT.strategy_center.event_bar_engine import *
from LQT.strategy_center.event_timer_engine import *
from LQT.strategy_center.event_online_engine import *

class StrategyBase(metaclass=ABCMeta):
    def __init__(self):
        self._now_time=datetime.now()
        self._database=pd.DataFrame(columns=['Issue','Number'])

    @property
    def now_time(self):
        return self._now_time

    @now_time.setter
    def now_time(self, value):
        self._now_time = value

    @property
    def database(self):
        return self._database

    @database.setter
    def database(self, value):
        self._database = value

    def run(self):
        self.initialize()  

        while True:
            run_timer_engine(self)
            run_online_engine(self)
            sleep(1)
            pass

    @abstractmethod
    def initialize(self):
        pass


class TestStrategy(StrategyBase):
    def initialize(self):
        self.now_time = datetime.now()

from LQT.selenium_api.selenium_yqw import YqwWeb

if __name__=='__main__':

    strategy=TestStrategy()
    strategy.run()

    a=input()